package com.project8.main;

import android.widget.SeekBar;

public class PageProgressBar {
	
	public PageProgressBar(SeekBar progressBar, final Main mainClass)
	{
		progressBar.setOnSeekBarChangeListener((new SeekBar.OnSeekBarChangeListener()
		{
			public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) 
			{
				if(progress == mainClass.currentPageNum -1)
					return;
				else if(progress >= mainClass.currentPageNum)
					mainClass.turnPage(mainClass.turnRightButton);
				else if(progress < mainClass.currentPageNum)
					mainClass.turnPage(mainClass.turnLeftButton);
				
								
				System.out.println("Current Progress = " + progress);
				System.out.println("Current Page     = " + mainClass.currentPageNum);
			}

			public void onStartTrackingTouch(SeekBar seekBar) 
			{				
			}

			public void onStopTrackingTouch(SeekBar seekBar) 
			{				
			}
     	
		}));
	}
}